package 力扣日常刷题.木22一月.第16天0128;

import 力扣日常刷题.ListNode;

/**
 * @author 帅小伙
 * @date 2022/1/28
 * @description
 */
public class Demo14JZ反转链表 {

    public ListNode reverseList(ListNode head) {
        if(head==null || head.next == null){
            return head;
        }
        ListNode node = reverseList(head.next);
        head.next.next = head;
        head.next = null;
        return node;

    }
}
